package com.lin.cloud.disk.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lin.cloud.disk.entity.dto.PhysicistRemoveDTO;
import com.lin.cloud.disk.entity.pojo.DirectoryClosure;
import com.lin.cloud.disk.entity.request.directory.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * (DirectoryClosure)表数据库访问层
 *
 * @author ljc
 * @since 2020-12-30 21:52:00
 */
@Repository
public interface DirectoryClosureMapper extends BaseMapper<DirectoryClosure> {

    /**
     * 批量创建目录闭包表格
     * @param directoryClosureList
     */
    void batchCreateDirectoryClosure(@Param("directoryClosureList") List<DirectoryClosure> directoryClosureList);


    /**
     * 获取祖先节点列表
     * @param request request
     * @return
     */
    List<DirectoryClosure> getAncestorList(GetAncestorListRequest request);

    /**
     * 获取根目录列表
     * @param request
     * @return
     */
    List<DirectoryClosure> getRootDirectoryList(GetRootDirectoryListRequest request);

    /**
     * 物理删除闭包表数据
     * @param physicistRemoveDTO
     * @return
     */
    int physicistRemoveDirectoryClosure(PhysicistRemoveDTO physicistRemoveDTO);

    /**
     * 获取子孙闭表列表数据 包括自己
     * @param request
     * @return
     */
    List<DirectoryClosure> getDescendantListAndMeByIdList(GetDescendantListAndMeByIdListRequest request);

    /**
     * 物理移动删除闭包表数据
     * @param moveRemoveDirectoryRequest
     * @return
     */
    int physicistMoveRemoveDirectoryClosure(MoveRemoveDirectoryRequest moveRemoveDirectoryRequest);


    /**
     * 获取下一级目录列表
     * @param request
     * @return
     */
    List<DirectoryClosure> getNextLevelDirectoryList(GetNextLevelDirectoryListRequest request);
}